<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>json.html</title>
		<script type="text/javascript">
		//JSON对象
			var obj={"name":"tom","age":20,"female":true};
			//alert(obj.name);
			var companys=["sun","oracle","ibm"];
			//alert(companys[2]);
			var ps=[{"name":"tom"},{"name":"jerry"}];
			for(i=0;i<ps.length;i++){
				//alert(ps[i].name);
			}
			///将json格式字符串转成json对象
			var str='{"name":"tom"}'
			var json=eval("("+str+")");
			alert(json.name);
		</script>
	</head>
	<body>
	</body>
</html>
